package com.ynns.rule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import com.netflix.loadbalancer.RoundRobinRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
//自定义Ribbon
@Configuration
public class YnnsRule {
    //自定义的方法
//    @Bean
//    public IRule myIrule(){
//        return new YnnsRandomRule();
//    }

    //随机
//    @Bean
//    public IRule myIrule(){
//        return new RandomRule();
//    }

    //默认的轮询
    @Bean
    public IRule myIrule(){
        return new RoundRobinRule();
    }
}
